const columns = [
  {
    title: "序号",
    width: 80,
    dataIndex: "index",
    key: "index",
    align: "center",
    customRender: (text, record, index) => `${index + 1}`,
  },
  {
    title: "员工姓名",
    dataIndex: "name",
    align: "center",
    key: "name",
  },
  {
    title: "性别",
    align: "center",
    dataIndex: "sex",
    key: "sex",
    customRender: (text, record, index) => {
      return caseSex(text);
    },
  },
  {
    title: "员工编号",
    align: "center",
    key: "employeeNumber",
    dataIndex: "employeeNumber",
  },
  {
    title: "部门",
    align: "center",
    key: "department",
    dataIndex: "department",
  },
  {
    title: "角色",
    align: "center",
    key: "roleName",
    dataIndex: "roleName",
  },
  {
    title: "职务",
    align: "center",
    key: "position",
    dataIndex: "position",
  },
  {
    title: "移动电话",
    align: "center",
    key: "phone",
    dataIndex: "phone",
  },
  {
    title: "籍贯",
    align: "center",
    key: "nativePlace",
    dataIndex: "nativePlace",
  },
  {
    title: "操作",
    dataIndex: "action",
    align: "center",
    fixed: "right",
    width: 150,
    scopedSlots: { customRender: "action" },
  },
];

function caseSex(value) {
  switch (value) {
    case 0:
      return "女";
    case 1:
      return "男";
  }
}

export { columns };
